home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
DDJMAG
/
DDJ9110.ZIP
/
STRING.ZIP
/
STRILT.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-30
|
733b
|
29 lines
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <string.hpp>
int operator<(const String &a, const String &b)
{
int c, m = a.length(), n = b.length(), l = m > n? n: m;
if ((c = memcmp(a.body(),b.body(),l)) > 0) return 1;
if (!c && n > m) return 1;
return 0;
}
int operator<(const String &a, const char *s)
{
int c, m = a.length(), n = strlen(s), l = m > n? n: m;
if ((c = memcmp(a.body(),s,l)) > 0) return 1;
if (!c && n > m) return 1;
return 0;
}
int operator<(const char *s, const String &a)
{
int c, m = strlen(s), n = a.length(), l = m > n? n: m;
if ((c = memcmp(s,a.body(),l)) > 0) return 1;
if (!c && n > m) return 1;
return 0;
}